import type { ComponentsConfig, ComponentsConfigRaw } from '../../types'
import { extendSchemas } from '@/components/cms/utils'
import advsConfig from './base/advs'
import { filterCriteria } from './simples'

const basePath = 'template.articleCategories'
const config: ComponentsConfig = {
  default: 'filterCriteria',
  components: extendSchemas<ComponentsConfigRaw>(
    {
      filterCriteria: filterCriteria({
        pageFields: {
          background: `${basePath}.background`
        },
        fields: {
          style: `${basePath}.content.style`,
          background: `${basePath}.content.background`,
          fill: `${basePath}.content.fillColor`,
          border: {
            color: `${basePath}.content.border.color`,
            width: `${basePath}.content.border.width`,
            radius: `${basePath}.content.border.radius`
          },
          text: {
            color: `${basePath}.content.text.color`,
            selectedColor: `${basePath}.content.text.selectedColor`
          }
        }
      })
    },
    advsConfig(['playerBeforeAdv', 'playerPauseAdv'])
  )
}
export default config
